package com.opesoft.pf.page;

import java.util.Date;

/**
 * 流程进度
 * 
 * @author Larlf
 * 
 */
public class ProcessRate
{
	int count = -1;

	int rate = -1;

	String msg = null;

	long startTime;

	//实现NullObject模式
	public static ProcessRate NULL = new ProcessRate();

	public ProcessRate()
	{
		this.startTime = new Date().getTime();
	}

	public int getCount()
	{
		return count;
	}

	public void setCount(int count)
	{
		this.count = count;
	}

	public int getRate()
	{
		return rate;
	}

	public void setRate(int rate)
	{
		this.rate = rate;
	}

	public String getMsg()
	{
		return msg;
	}

	public void setMsg(String msg)
	{
		this.msg = msg;
	}

	public int getPercent()
	{
		if(this.getCount() > 0 && this.getRate() >= 0)
		{
			return this.getRate() * 100 / this.getCount();
		}
		return 0;
	}

}
